unit UPrincipal;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Menus, ExtCtrls, StdCtrls, Buttons, jpeg, ComCtrls,
  UCadCliente,
  UCadConteiner,
  UPainelLocacao;

type
  TFormPrincipal = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    TreeViewOpcao: TTreeView;
    Label3: TLabel;
    Image2: TImage;
    Panel1: TPanel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    Label11: TLabel;
    Label12: TLabel;
    MonthCalendar1: TMonthCalendar;
    procedure TreeViewOpcaoClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormPrincipal: TFormPrincipal;
  FormCadCliente : TFormCadCliente;
  FormCadConteiner : TFormCadConteiner;
  FormPainelLocacao : TFormPainelLocacao;

implementation

{$R *.dfm}

procedure TFormPrincipal.TreeViewOpcaoClick(Sender: TObject);
begin

if TreeViewOpcao.Selected.SelectedIndex = 1 then
begin
  FormCadCliente := TFormCadCliente.Create(Owner);
  FormCadCliente.ShowModal;
  FormCadCliente.free;
end;
if TreeViewOpcao.Selected.SelectedIndex = 2 then
begin
  FormCadConteiner := TFormCadConteiner.Create(Owner);
  FormCadConteiner.ShowModal;
  FormCadConteiner.free;
end;
if TreeViewOpcao.Selected.SelectedIndex = 20 then
begin
  FormPainelLocacao := TFormPainelLocacao.Create(owner);
  FormPainelLocacao.ShowModal;
  FormPainelLocacao.free;
end;
if TreeViewOpcao.Selected.SelectedIndex = 999 then
begin
  formPrincipal.Close;
end;

end;

end.
